#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Created by master on 2017/2/15

loginCount = 0
f = open("login_count.txt", "r")
f.write(loginCount)
f.close()


while loginCount < 3:

    username = input("请输入您的用户名：")
    password = input("请输入您的密码：")
    if username == "tom" and password == "123456":
        print("恭喜您登录成功！")
        break
    else:
        print("用户名或密码错误，还能输入 %d 次" % (3 - (loginCount + 1)))
        loginCount += 1


else:
    print("程序已经锁定！")
